package grgu.rud.glava9.c5;

public class Student {

	private String surname;
	private int[] marks;

	public Student(String surname, int[] marks) {
		this.surname = surname;
		this.marks = marks.clone();
	}

	public String getSurname() {
		return surname;
	}

	public void setSurname(String surname) {
		this.surname = surname;
	}

	public int[] getMarks() {
		return marks;
	}

	public double getAverageMark() {
		double sum = 0;
		double avMark = 0;
		for (int i = 0; i < marks.length; i++) {
			sum += marks[i];
		}
		avMark = sum / marks.length;
		return avMark;
	}

	public void makeSomeSurnameUp() {
		if (getAverageMark() > 7.0) {
			setSurname(surname.toUpperCase());
		}
	}

}
